<template>
  <div>
    <el-row>
      <el-col
        :span="8"
        v-for="(o, index) in n"
        :key="o"
        :offset="index > 0 ? 2 : 0"
      >
        <el-card :body-style="{ padding: '0px' }">
          <div style="padding: 14px">
            <span>Demo</span>
            <div class="bottom clearfix">
              <time class="time">{{ currentDate }}</time>
              <el-button type="text" class="button">操作按钮</el-button>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
    <button class="btn" :style="{ color: color }">
      <slot />
      <!-- 插槽 -->
    </button>
  </div>
</template>

<script>
export default {
  // 传入子组件的参数写到props
  props: {
    color: {
      type: String, // 颜色参数类型
      default: "#000", // 默认黑色
    },
  },
  data() {
    return {
        n:[2],
      currentDate: new Date(),
    };
  },
};
</script>

<style scoped>
.btn {
  width: 110px;
  height: 60px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
}
</style>

<style>
.time {
  font-size: 13px;
  color: #999;
}

.bottom {
  margin-top: 13px;
  line-height: 12px;
}

.button {
  padding: 0;
  float: right;
}

.image {
  width: 100%;
  display: block;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}

.clearfix:after {
  clear: both;
}
</style>
